import request from '@/utils/request'

// 获取员工简单列表
export const getEmployeeSimple = () => request({
  url: '/sys/user/simple'
})

// 获取员工列表
export const getEmployeeList = params => request({
  url: '/sys/user',
  params
})

// 新增员工
export const addEmployee = data => request({
  url: '/sys/user',
  method: 'post',
  data
})

// 删除员工
export const delEmployee = id => request({
  url: `/sys/user/${id}`,
  method: 'DELETE'
})

// 批量导入员工
export const addEmployees = data => request({
  url: '/sys/user/batch',
  method: 'POST',
  data
})

// 获取员工基本信息
export const getUser = id => request({
  url: `/sys/user/${id}`
})

// 保存员工基本信息
export const setUser = data => request({
  url: `/sys/user/${data.id}`,
  method: 'PUT',
  data
})

// 获取员工个人信息
export const getPersonalInfo = id => request({
  url: `/employees/${id}/personalInfo`
})
// 获取员工岗位信息
export const getJobs = id => request({
  url: `/employees/${id}/jobs`
})
